// new standard header
#ifndef _NEW_
#define _NEW_
#pragma option push -b -a8 -pc -Vx- -Ve- -w-inl -w-aus -w-sig
#include <exception>

 #if __GNUC__ < 3
_X_STD_BEGIN

 #else /* __GNUC__ < 3 */
namespace std {
 #endif /* __GNUC__ < 3 */

		// CLASS bad_alloc
class bad_alloc
	: public _XSTD exception
	{	// base of all bad allocation exceptions
public:

 #if __EDG__ || defined(__SUNPRO_CC)
	bad_alloc(const char *_Message = _MESG("bad allocation")) _THROW0()
		: exception(_Message)
		{	// construct from message string
		}

 #else /* __EDG__ etc. */
	bad_alloc() _THROW0()
		{	// construct with no message string
		}

	virtual const char *what() const _THROW0()
		{	// report a bad allocation
		return ("bad allocation");
		}
 #endif /* __EDG__ etc. */

//	virtual ~bad_alloc() _THROW0()
//		{}	// destroy the object

 #if _HAS_EXCEPTIONS

 #else /* _HAS_EXCEPTIONS */

protected:
	virtual void _Doraise() const
		{	// perform class-specific exception handling
		_RAISE(*this);
		}
 #endif /* _HAS_EXCEPTIONS */

	};

 #if __GNUC__ < 3
_X_STD_END

 #else /* __GNUC__ < 3 */
} /* namespace std */

 #if _HAS_NAMESPACE

 #else /* _HAS_NAMESPACE */
using std::bad_alloc;
 #endif /* _HAS_NAMESPACE */

 #endif /* __GNUC__ < 3 */

_STD_BEGIN
		// SUPPORT TYPES
typedef void (*new_handler)();	// handler for operator new failures

struct nothrow_t
	{	// placement new tag type to suppress exceptions
	};

extern const _CRTIMP2 nothrow_t nothrow;	// constant for placement new tag

		// FUNCTION AND OBJECT DECLARATIONS
_CRTIMP2 new_handler set_new_handler(new_handler)
	_THROW0();	// establish alternate new handler

extern _CRTIMP2 new_handler _New_hand;	// pointer to current new handler
_STD_END

		// new AND delete DECLARATIONS (NB: NOT IN std)

 #if defined(__SUNPRO_CC)
void operator delete(void *) throw();	// delete allocated storage

void *operator new(_CSTD size_t)
	throw(std::bad_alloc);	// allocate or throw exception

 #else /* defined(__SUNPRO_CC) */
void operator delete(void *) _THROW0();	// delete allocated storage

void *operator new(_CSTD size_t)
	_THROW1(_XSTD bad_alloc);	// allocate or throw exception
 #endif /* defined(__SUNPRO_CC) */

void *operator new(_CSTD size_t, const _STD nothrow_t&)
	_THROW0();	// allocate or return null pointer

inline void *operator new(_CSTD size_t, void *_Where) _THROW0()
	{	// construct with placement at _Where
	return (_Where);
	}

 #if defined(__SUNPRO_CC)
void operator delete[](void *) throw();	// delete allocated array

void *operator new[](_CSTD size_t)
	throw(std::bad_alloc);	// allocate array or throw exception

 #else /* defined(__SUNPRO_CC) */
void operator delete[](void *) _THROW0();	// delete allocated array

void *operator new[](_CSTD size_t)
	_THROW1(_XSTD bad_alloc);	// allocate array or throw exception
 #endif /* defined(__SUNPRO_CC) */

void *operator new[](_CSTD size_t, const _STD nothrow_t&)
	_THROW0();	// allocate array or return null pointer

inline void *operator new[](_CSTD size_t, void *_Where) _THROW0()
	{	// construct array with placement at _Where
	return (_Where);
	}

void operator delete(void *, const _STD nothrow_t&)
	_THROW0();	// delete if nothrow new fails -- REPLACEABLE

void operator delete[](void *, const _STD nothrow_t&)
	_THROW0();	// delete if nothrow array new fails -- REPLACEABLE

void operator delete(void *, void *) _THROW0();
//	{}	// delete if placement new fails

void operator delete[](void *, void *) _THROW0();
//	{}	// delete if placement array new fails
#pragma option pop
#endif /* _NEW_ */

/*
 * Copyright (c) 1992-2003 by P.J. Plauger.  ALL RIGHTS RESERVED.
 * Consult your license regarding permissions and restrictions.
V4.02:1422 */
